Migration from 5.X
Version 6.0.0 introduces a well defined, typed, way of passing extra values, options, parameters or flags to the financial transactions.
We have unified all the extra and optional parameters in an Options object. Different operations have different options.
1. For a Sale or Sale and Tokenize operation, please see SaleOptions
If you use a customer reference:
options.setCustomerReference("Your customer reference");
If you need Multi MID / Custom merchant Authentication:
MerchantAuth auth = new MerchantAuth();
Credential credential = new Credential();
//Optionally
credential.setAcquirer(YOUR_ACQUIRER);
//Optionally
credential.setMerchantId(mid);
//Optionally
credential.setTerminalId(tid);
//Add as many credentials as Acquirers your merchant have agreements with
auth.add(credential);
options.setMerchantAuth(auth);
If you need to enable pin bypass:
options.setPinBypass(true);
If you want to specify the budget period Only available for SureSwipe:
options.setBudgetNumber(YOUR_BUDGET_NUMBER);
If you want to specify tip options Only available for PAX and Telpo terminals:
TipConfiguration config = new TipConfiguration();
//Optionally
config.setHeaderName(HEADER);
//Optionally
config.setFooter(FOOTER);
//Optionally
config.setEnterAmountEnabled(true);
//Optionally
config.setSkipEnabled(true);
//Optionally
config.setTipPercentages(percentages);
options.setTipConfiguration(config);
Alternatively, you can set the tip amount directly:
options.setTipConfiguration(new TipConfiguration(AMOUNT));
Finally:
api.sale(amount, currency, options);
2. Similar to SaleOptions, but with less possible parameters, for a Refund operation, please see RefundOptions
If you use a customer reference:
options.setCustomerReference("Your customer reference");
If you need Multi MID / Custom merchant Authentication:
MerchantAuth auth = new MerchantAuth();
Credential credential = new Credential();
//Optionally
credential.setAcquirer(YOUR_ACQUIRER);
//Optionally
credential.setMerchantId(mid);
//Optionally
credential.setTerminalId(tid);
//Add as many credentials as Acquirers your merchant have agreements with
auth.add(credential);
options.setMerchantAuth(auth);
If you need to enable pin bypass:
options.setPinBypass(true);
Finally:
api.refund(amount, currency, options);
3. For the rest of operations, please see Options
If you use a customer reference:
options.setCustomerReference("Your customer reference");